package com.company.project.core.exception;

/**
 * =================================
 * <p>
 * Created by cjj on 18-4-8.
 * <p>
 * 描述: 全局异常枚举类
 */

public enum ExceptionEnum {

    /**
     * 系统异常
     */
    NULL_POINTER_EXCEPTION(100001, "空指针引用异常"),
    CLASS_CAST_EXCEPTION(100002, "类型强制转换异常"),
    ILLEAGAL_ARGUMENT_EXCEPTION(100003, "传递非法参数异常"),
    ARITHMETIC_EXCEPTION(100004, "算术运算异常"),
    ARRAY_STORE_EXCEPTION(100005, "向数组中存放与声明类型不兼容对象异常"),
    INDEX_OUT_OF_BOUNDS_EXCEPTION(100006, "下标越界异常"),
    NEGATIVE_ARRAY_SIZE_EXCEPTION(100007, "创建一个大小为负数的数组错误异常"),
    NUMBER_FORMAT_EXCEPTION(100008, "数字格式异常"),
    SECURITY_EXCEPTION(100009, "安全异常"),
    UNSUPPORTED_OPERATION_EXCEPTION(100010, "不支持的操作异常"),

    CREATE_HASVALUE(101001,"已存在的名称，请重新输入后提交"),
    DELETE_EXCEPTION(101002,"删除失败，查无此记录"),
    UPDATE_EXCEPTION(101003, "更新异常，请根据提示确认后提交");

    /**
     * 自定义异常
     */

    /**
     * 自定义异常码
     */
    private int code;
    /**
     * 异常信息
     */
    private String msg;

    ExceptionEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
